export const useCounter = () => {
  const counter = useState("counter", () => 0);

  function increment() {
    counter.value++;
  }

  function decrement() {
    if (counter.value <= 0) return;
    counter.value--;
  }

  return {
    counter,
    increment,
    decrement,
  };
};
